#include "mpLog.h"
#include "mpWin32FuncTests.h"
#include "mpWin32Func.h"
#include "mpLocaleUtils.h"

mpWin32FuncTests::mpWin32FuncTests()
{

}

void mpWin32FuncTests::initTestCase(){}
void mpWin32FuncTests::cleanupTestCase(){}
void mpWin32FuncTests::case_getUserAndPath(){
#ifdef TEST_STRATEGY_COMPLETED

#if defined(PLATFORM_WINDOWS)

    std::wstring userName0;
    std::wstring userName;
    std::wstring sid;

    std::wstring localPath;
    std::wstring destopPath;
    std::wstring allUserLocalPath;

    std::wstring svr_localPath;
    std::wstring svr_roamingPath;


    MP::Win32Func::mpsGetCurrentLogonUserName(userName0);
    MP::Win32Func::mpsGetCurrentLogonUserNameAndSid(userName,sid);

    MP::Win32Func::mpsGetDefaultUserLocalPath(localPath);
    MP::Win32Func::mpsGetDefaultUserDestopPath(destopPath);
    MP::Win32Func::mpsGetDefaultAllUserLocalPath(allUserLocalPath);

    MP::Win32Func::mpsGetCurrentLogonUserLocalPath(svr_localPath);
    MP::Win32Func::mpsGetCurrentLogonUserRoamingPath(svr_roamingPath);


    MPLOG_INFO << "[mpsGetCurrentLogonUserName] userName:" << MP::LocaleUtils::unicode_to_sys_encoding(userName0);
    MPLOG_INFO << "[mpsGetCurrentLogonUserNameAndSid] userName:" << MP::LocaleUtils::unicode_to_sys_encoding(userName)
               << " sid:" << MP::LocaleUtils::unicode_to_sys_encoding(sid);

    MPLOG_INFO << "[mpsGetDefaultUserLocalPath] localPath:" << MP::LocaleUtils::unicode_to_sys_encoding(localPath);
    MPLOG_INFO << "[mpsGetDefaultUserDestopPath] destopPath:" << MP::LocaleUtils::unicode_to_sys_encoding(destopPath);
    MPLOG_INFO << "[mpsGetDefaultAllUserLocalPath] allUserLocalPath:" << MP::LocaleUtils::unicode_to_sys_encoding(allUserLocalPath);

    MPLOG_INFO << "[mpsGetCurrentLogonUserLocalPath] svr_localPath:" << MP::LocaleUtils::unicode_to_sys_encoding(svr_localPath);
    MPLOG_INFO << "[mpsGetCurrentLogonUserRoamingPath] svr_roamingPath:" << MP::LocaleUtils::unicode_to_sys_encoding(svr_roamingPath);


    QVERIFY2(userName0 == userName,"获取当前登录用户名称");
    QVERIFY2(localPath == svr_localPath,"获取当前登录用户Local目录");



#endif //PLATFORM_WINDOWS


#endif
}
